Part 52: Assignment #25: Meat-Based Printer
Meat-Based PrinterThis sounds like a useful little gadget! One thing's nagging at me, though. Is this supposed to be like, real meat shipped in? Or like... faux meat? I'm not entirely sure what "common substrate" is supposed to imply.
Basically, we're just sending patterns to the output from the keypad, which makes this a refined version of the pulse generator, or the signal amplifier from way back when I started. There's a printout detailing the patterns - though the most interesting part of it isn't the actual patterns themselves.
It's the way the machine is set up. It's gotta have two internal bins - one for "lean mix", and one for "fat mix". (For those who are wondering, you set valves to 0 (off) for lean mix, and 100 (on) for fat mix.) I'm not sure how the extrude output ensures equal... well, 'meat pressure'... from both the bins, but it apparently does.
From a design perspective, this could be a little complicated. Not the basic idea (making patterns on cue), but actually generating that specific set of patterns. They don't overlap much, so I'll have to devote separate logic to each one, without reusing much. That'll cut into efficiency.
That said, I've been futzing around with the prototyping bin recently, and it's given me an idea...
[ ~ ]
OK, so you might not believe what my first draft looks like. But here it is!
Yeah - that's right. I figured out the PGA33X6 worked. (Though that said - I had help. Thanks @Jabor!)
If you weren't around for Jabor's explanation, you can just think of the PGA (for now*) as a chip that acts like a bundle of logic gates wired together, taking patterns of input and turning them into different patterns of output.
*I've got a Corner post queued after this one that explains the PGA33X6 a little better. If you're confused, hang in there!
This PGA is set as follows: counting just the top two input lines, but all three output lines:
[ 0 0 ] (both inputs off) becomes [ 0 0 0 ]
[ 1 0 ] (upper input on) becomes [ 1 0 1 ]
[ 0 1 ] (middle input on) becomes [ 1 1 1 ]
[ 1 1 ] (both inputs on) becomes [ 0 1 0 ]
An easy way to think about it: the top input line switches the output pattern between [ 0 0 0 ] and [ 1 0 1 ], and the middle input applies a NOT (inverse) to that (turning [ 0 0 0 ] into [ 1 1 1 ], and [ 1 0 1 ] into [ 0 1 0 ]).
The bottom input line triggers the "bacon pattern", [ 0 1 1 ]. No other meat styles use it, and it's held for a long time, so it seemed simplest to give it its own dedicated input line.
The two small MCs in the middle, near the PGA, basically feed the patterns necessary for each style of meat. The small MC on the left reads from the keypad, turns on extrude (and the bacon pattern, if that's what's requested), and cues the other two MCs.
The whole thing, right now, costs ¥14. The power usage is surprisingly efficient, given there's a PGA inside - it turns out PGAs mostly draw power when their input or output changes, which varies per meat style. 200 average power per run.
That said, remember how I said the PGA is behaving like a bundle of logic gates? It has occurred to me in typing all this up that I'm not using any of the advanced features (like the data register) of the PGA, so I might get better results if I replaced it with an actual bundle of logic gates. I'll try that next and see what I get.
[ ~ ~ ]
I think this is the first time I've had to run a wire under a chip, even if it's only briefly - I'll include a wiring diagram whenever I have to do this. But that's not the important part of this design. The important part is Bundle of Logic Gates: 1. PGA: Zip!
More accurately, the logic gates cost ¥4 (¥1 less than the PGA), and consume no power, driving the average power usage per run down to 115 units. Given that this might be set up in a disaster area, I'm thinking that long-lasting batteries are a significant goal here.
The setup with the MCs is mostly the same, but their code has been tweaked a little to better their power usage. They still push out the same pulses on the same time units.
The logic gates are set up as follows: the two XOR gates (the left two gates) to valves-0 and 2 act to set up the [ 1 0 1 ] + [ invert ] functions of the two MCs in the middle. The [ 1 0 1 ] only needs to be connected to valve-0 and valve-2 because the turning on the [ 1 0 1 ] MC's output never had any effect on valve-1 to begin with.
The two plain OR gates on the right are there to add the 'bacon' pattern into the mix - when turned on, that pattern overrides whatever was being fed to valve-1 and valve-2 before.
While this looks pretty optimized at ¥13, I'm going to check if there's any easier way to string up these gates. Logic gate optimization is a slippery business - I remember taking a class that touched on this back in college. I get to draw Karnaugh maps again!
[ ~ ~ ~ ]
Here it is - as optimized as I'd say I can get it. Still three small MCs, but only two logic gates this time, and both of those are for the bacon pattern override.
This works because the two middle MCs' functions (and positions) have changed. While before they were [ 1 0 1 ] and [ invert ], now they're [ 1 0 1 ] and [ 0 1 0 ]. So the XOR gates aren't needed to add the two results together to get the correct output - now, the upper middle MC just handles valve-0 and valve-2, and the lower middle MC is only responsible for valve-1. We can still get any of the four non-bacon output patterns by turning on the two middle MCs' outputs in some combination.
[ 0 0 0 ] = both MCs off
[ 1 0 1 ] = upper middle MC on
[ 0 1 0 ] = lower middle MC on
[ 1 1 1 ] = both MCs on
Because of this, the two middle MCs' code has to change as well. The upper middle MC is now only used for cutlet-style meat, so it waits for the lower middle MC (used for cutlet- and steak-style) to trigger it. The MC on the left, which handles bacon and the extruder feed, is about the same.
All of this together results in a significant cost and power savings - ¥11 and 106 average power per run. Now time to send this design to the grill... er, factory.
And the results are in: To be honest, the meat is pretty good. I mean, it's a little above fast food quality, but this is basically what's been in chicken nuggets since time immemorial and no one's ever complained. My favorite was the steak-style meat I admit I'm a lean-meat fan. That said, cutlet-style was pretty good. The only one I was really disappointed with was bacon-style. Real bacon is cured or salted or smoked or whatever the heck people use to preserve it, and the printer mix wasn't nearly salty/smoky/whatever enough to fake it.
Still, I imagine if a flood, or a hurricane, etc., wrecked my city, I wouldn't mind some nice generated meat.
P.S: Holy shit, Lamia fans. I wasn't expecting a comedy episode like that (how do you drive a car if you have a giant snake tail?) to take such a dramatic turn! Playing the resulting crash for drama (and on a cliffhanger, too!) almost feels kinda cheap emotionally, but to be honest, it's got me hooked.
Still, I was paying attention at that early shot, where the guy put on his seat belt. He'll be fine. I'm pretty sure.